package com.gk.javaservice.service.impl;

import com.gk.javaservice.dao.AtsPersonnelDao;
import com.gk.javaservice.po.AtsPersonnel;
import com.gk.javaservice.service.AtsPersonnelService;
import com.gk.javaservice.util.time.TimeUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class AtsPersonnelServiceImpl implements AtsPersonnelService {
    @Autowired
    private AtsPersonnelDao baseDao;
    @Override
    public void add(AtsPersonnel basebin) {
        String getTime = TimeUtil.dateFormat();
        basebin.setCreatedAt(getTime);
        basebin.setUpdatedAt(getTime);
        baseDao.add(basebin);
    }

    @Override
    public Integer update(AtsPersonnel basebin) {
        String getTime = TimeUtil.dateFormat();
//        basebin.setCreated_at(getTime);
        basebin.setUpdatedAt(getTime);
        return baseDao.update(basebin);
    }

    @Override
    public Integer delete(Object id) {
        return baseDao.delete(id);
    }

    @Override
    public List<AtsPersonnel> hasAll() {
        return baseDao.hasAll();
    }

    @Override
    public AtsPersonnel hasById(Object id) {
        return baseDao.hasById(id);
    }

   

    @Override
    public List<AtsPersonnel> hasAllToPage(int offset, int limit,String searchMsg) {
        return baseDao.hasAllToPage(offset,limit,searchMsg);
    }

    @Override
    public int queryTotal(String searchMsg) {
        return baseDao.queryTotal(searchMsg);
    }

    @Override
    public int countByuserId(String userId) {
        return baseDao.countByuserId(userId);
    }
}
